package org.rency.common.utils.money;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * 币种
 * @author: user_rcy@163.com
 * </br>Created on 2015年11月17日
 * @version: V1.0.0
 * @since JDK 1.8
 */
public enum CurrencyKind {

	CNY("CNY","￥","人民币"),
	HKD("HKD","HK$","港元"),
	MOP("MOP","P","澳门元"),
	US("US","$","美元"),
	EUR("EUR","€","欧元"),
	;
	
	private String code;
	private String codeChar; 
	private String msg;
	
	CurrencyKind(String code,String codeChar,String msg){
		this.code = code;
		this.codeChar = codeChar;
		this.msg = msg;
	}
	
	public String getCode(){
		return this.code;
	}
	
	public String getCodeChar(){
		return this.codeChar;
	}
	
	public String getMsg(){
		return this.msg;
	}
	
	public static CurrencyKind get(String code){
		for(CurrencyKind mode : CurrencyKind.values()){
			if(mode.code.equals(code.toUpperCase())){
				return mode;
			}
		}
		return null;
	}
	
	public String toString(){
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}
}